home *** CD-ROM | disk | FTP | other *** search
- global gSlowMachine, gDartSprite, gDartHandSprite, gHandAiming, gHandReleasing, gDart0, gDart1, gDart2, gDart3, gDart4, gDart5, gDart6, gDart7, gGreenBalloon, gGreenBalloonPopped, gOrangeBalloon, gOrangeBalloonPopped, cHotCursor, cGeneralCursor, gHot, gHotMask, gBalloonSprite, gDeedBalloon, gBalloonsPopped, gDarts, gTokens, gTokenSprite, gStartDarts
-
- on playDarts
- puppetSprite(gDartHandSprite, 1)
- set userV to the mouseV
- set userH to the mouseH
- if userH < 128 then
- if inside(point(userH, userV), rect(0, 362, 108, 384)) then
- cursor([gHot, gHotMask])
- else
- cursor(200)
- end if
- end if
- set userH to checkRange(userH, 128, 393)
- set the locH of sprite gDartHandSprite to userH
- updateStage()
- if userV > 370 then
- moveHandDown(384)
- startTimer()
- set gStartDarts to 1
- go(the frame)
- exit
- else
- if userV > 360 then
- go(the frame)
- exit
- else
- if gStartDarts <> 1 then
- go(the frame)
- exit
- end if
- if the timer < 150 then
- if gDarts < 1 then
- if gTokens = 0 then
- loseGame()
- exit
- else
- set gTokens to gTokens - 1
- set gDarts to gDarts + 5
- showTokens()
- end if
- end if
- set gDarts to gDarts - 1
- set throwDart to 1
- set target to 0
- delayFor(10)
- set percentH to (userH - 128) * 1.0 / 275
- set percentH to checkRange(percentH, 0.01, 1.0)
- set destinationH to ((373 - 138) * percentH) + 138
- set userV to the mouseV
- set userV to checkRange(userV, 200, 360)
- set percentV to (userV - 220) * 1.0 / 160
- set percentV to checkRange(percentV, 0.01, 1.0)
- set destinationV to ((322 - 65) * percentV) + 65
- set destinationPoint to point(destinationH, destinationV)
- repeat with x = gBalloonSprite to gBalloonSprite + 19
- set locHx to the locH of sprite x
- set locVx to the locV of sprite x
- set checkRect to rect(the left of sprite x, the top of sprite x, the right of sprite x, the bottom of sprite x)
- if inside(destinationPoint, checkRect) then
- if (the castNum of sprite x = gGreenBalloonPopped) or (the castNum of sprite x = gOrangeBalloonPopped) then
- exit repeat
- end if
- set checkRect to rect(locHx - 15, locVx - 15, locHx + 15, locVx + 15)
- if inside(destinationPoint, checkRect) then
- set target to x
- set gBalloonsPopped to gBalloonsPopped + 1
- set destinationPoint to point(locHx + random(5) - 10, locVx + random(5) - 10)
- exit repeat
- else
- if destinationH < locHx then
- set destinationH to destinationH - 15
- else
- set destinationH to destinationH + 17
- end if
- if destinationV < locVx then
- set destinationV to destinationV - 10
- else
- set destinationV to destinationV + 10
- end if
- set destinationPoint to point(destinationH, destinationV)
- exit repeat
- end if
- next repeat
- end if
- end repeat
- if the locV of sprite gDartHandSprite > 351 then
- repeat with x = the locV of sprite gDartHandSprite down to 351
- set the locV of sprite gDartHandSprite to x
- updateStage()
- set x to x - 1
- end repeat
- set the locV of sprite gDartHandSprite to 351
- updateStage()
- end if
- set userV to 315
- set the castNum of sprite gDartHandSprite to gHandReleasing
- updateStage()
- activate(gDartSprite, gDart1, 1, 36, -5000, -5000, EMPTY, EMPTY, EMPTY)
- set the backColor of sprite gDartSprite to 204
- updateStage()
- sound stop 1
- puppetSound(0)
- if target > 0 then
- puppetSound("Balloon, pop")
- updateStage()
- else
- puppetSound("Dart, miss")
- updateStage()
- end if
- if (gSlowMachine = 1) or (programmersKey() = 1) then
- updateDart(gDart1, userH, userV, destinationH, destinationV, 1.10000000000000009)
- updateDart(gDart1, userH, userV, destinationH, destinationV, 1.20000000000000018)
- updateDart(gDart2, userH, userV, destinationH, destinationV, 1.40000000000000013)
- updateDart(gDart2, userH, userV, destinationH, destinationV, 1.70000000000000018)
- updateDart(gDart3, userH, userV, destinationH, destinationV, 2.10000000000000009)
- updateDart(gDart3, userH, userV, destinationH, destinationV, 2.60000000000000009)
- updateDart(gDart4, userH, userV, destinationH, destinationV, 3.20000000000000018)
- updateDart(gDart4, userH, userV, destinationH, destinationV, 3.90000000000000036)
- else
- updateDart(gDart1, userH, userV, destinationH, destinationV, 1.10000000000000009)
- updateDart(gDart1, userH, userV, destinationH, destinationV, 1.20000000000000018)
- updateDart(gDart1, userH, userV, destinationH, destinationV, 1.40000000000000013)
- updateDart(gDart2, userH, userV, destinationH, destinationV, 1.70000000000000018)
- updateDart(gDart2, userH, userV, destinationH, destinationV, 2.10000000000000009)
- updateDart(gDart2, userH, userV, destinationH, destinationV, 2.60000000000000009)
- updateDart(gDart3, userH, userV, destinationH, destinationV, 3.20000000000000018)
- updateDart(gDart3, userH, userV, destinationH, destinationV, 3.90000000000000036)
- updateDart(gDart3, userH, userV, destinationH, destinationV, 4.70000000000000018)
- updateDart(gDart4, userH, userV, destinationH, destinationV, 5.60000000000000053)
- updateDart(gDart4, userH, userV, destinationH, destinationV, 6.60000000000000053)
- updateDart(gDart4, userH, userV, destinationH, destinationV, 7.70000000000000018)
- end if
- do("set the castNum of sprite gDartSprite=gDart" & random(3) + 4)
- set the loc of sprite gDartSprite to point(destinationH, destinationV)
- if gBalloonsPopped = gDeedBalloon then
- set deedSprite to gDartHandSprite + 1
- put target, the locH of sprite target, the locV of sprite target
- set coords to adjustedCoords(the locH of sprite target, the locV of sprite target, -7, -12, 7, 12, 1)
- set the visible of sprite deedSprite to 1
- activate(deedSprite, "Parchment", 1, 36, -7, -12, "stretch to:", 7, 12)
- set the backColor of sprite deedSprite to 204
- end if
- if target > 0 then
- puppetSprite(target, 1)
- if the castNum of sprite target = gGreenBalloon then
- set the castNum of sprite target to gGreenBalloonPopped
- else
- if the castNum of sprite target = gOrangeBalloon then
- set the castNum of sprite target to gOrangeBalloonPopped
- end if
- end if
- updateStage()
- else
- end if
- if gBalloonsPopped = gDeedBalloon then
- winGame(target, deedSprite)
- exit
- else
- set delayFor to the timer + 60
- repeat while the timer < delayFor
- moveHandAcross()
- end repeat
- end if
- set the castNum of sprite gDartHandSprite to gHandAiming
- repeat while the mouseV < 370
- moveHandAcross()
- end repeat
- else
- if the locV of sprite gDartHandSprite > 358 then
- repeat with x = the locV of sprite gDartHandSprite down to 358
- set the locV of sprite gDartHandSprite to x
- updateStage()
- set x to x - 1
- end repeat
- set the locV of sprite gDartHandSprite to 384
- updateStage()
- end if
- startTimer()
- end if
- end if
- end if
- go(the frame)
- end
-
- on fnc startPoint, endPoint, whichStep
- if voidp(whichStep) then
- set whichStep to 1
- end if
- if whichStep = 0 then
- set whichStep to 1
- end if
- return endPoint - ((endPoint - startPoint) / whichStep)
- end
-
- on updateDart whichDart, userH, userV, destinationH, destinationV, whichValue
- set the castNum of sprite gDartSprite to whichDart
- set the loc of sprite gDartSprite to point(fnc(userH, destinationH, whichValue), fnc(userV, destinationV, whichValue))
- updateStage()
- end
-
- on adjustedCoords targetH, targetV, h1, v1, h2, v2, whichStep
- set h1 to fnc(h1 + targetH, 258, whichStep)
- set h2 to fnc(h2 + targetH, 258, whichStep)
- set v1 to fnc(v1 + targetV, 184, whichStep)
- set v2 to fnc(v2 + targetV, 184, whichStep)
- set newCoordinates to [h1, v1, h2, v2]
- return newCoordinates
- end
-
- on adjustedTokenCoords targetH, targetV, h1, v1, h2, v2, whichStep
- set h1 to fnc(h1 + targetH, 305, whichStep)
- set h2 to fnc(h2 + targetH, 305, whichStep)
- set v1 to fnc(v1 + targetV, 170, whichStep)
- set v2 to fnc(v2 + targetV, 170, whichStep)
- set newCoordinates to [h1, v1, h2, v2]
- return newCoordinates
- end
-
- on findCoord pCenter, pTopLeft, pBottomRight
- put getAt(pTopLeft, 1) - getAt(pCenter, 1) & ", " & getAt(pTopLeft, 2) - getAt(pCenter, 2) & ", " & getAt(pBottomRight, 1) - getAt(pCenter, 1) & ", " & getAt(pBottomRight, 2) - getAt(pCenter, 2)
- end
-
- on winGame target, deedSprite
- set gDeedBalloon to 0
- delayFor(5)
- set coords to adjustedCoords(the locH of sprite target, the locV of sprite target, -35, -39, 36, 38, 1)
- spriteBox(deedSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedCoords(the locH of sprite target, the locV of sprite target, -63, -65, 64, 65, 1.10000000000000009)
- spriteBox(deedSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedCoords(the locH of sprite target, the locV of sprite target, -92, -91, 92, 91, 1.30000000000000004)
- spriteBox(deedSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedCoords(the locH of sprite target, the locV of sprite target, -120, -118, 120, 117, 1.40000000000000013, 1.70000000000000018)
- spriteBox(deedSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set the stretch of sprite deedSprite to 0
- set the loc of sprite deedSprite to point(258, 184)
- delayFor(5)
- moveHandDown(420)
- set the locV of sprite gDartHandSprite to -5000
- cursor(-1)
- set flash1 to gDartHandSprite - 3
- set flash2 to gDartHandSprite - 2
- activate(flash1, "flash1", 1, 0, 105, -5000, EMPTY, EMPTY, EMPTY)
- activate(flash2, "flash2", 1, 0, 406, -5000, EMPTY, EMPTY, EMPTY)
- puppetSound("Win Game")
- deactivate([gDartHandSprite + 1])
- go("deed")
- repeat while the soundBusy of 1
- repeat with x = gBalloonSprite to gBalloonSprite + 19
- flashBalloons(x, flash1, flash2, 193, -5000)
- flashBalloons(x, flash1, flash2, -5000, 203)
- end repeat
- end repeat
- deactivate([flash1, flash2])
- puppetSound(0)
- updateStage()
- end
-
- on flashBalloons x, flash1, flash2, locV1, locV2
- if the castNum of sprite x = gGreenBalloon then
- set the castNum of sprite x to gOrangeBalloon
- else
- if the castNum of sprite x = gOrangeBalloon then
- set the castNum of sprite x to gGreenBalloon
- end if
- end if
- set the locV of sprite flash1 to locV1
- set the locV of sprite flash2 to locV2
- updateStage()
- delay(30)
- end
-
- on loseGame
- puppetSound("Lose Game")
- moveHandDown(420)
- set the locV of sprite gDartHandSprite to -5000
- updateStage()
- cursor(-1)
- delayFor(120)
- scene2()
- end
-
- on scene2
- set gStartDarts to 0
- set gBalloonsPopped to 0
- if random(3) = 1 then
- set gDeedBalloon to random(4) + 1
- else
- set gDeedBalloon to random(15) + 5
- end if
- puppetSound(0)
- setProp(1, 48, "puppet", 0)
- setProp(1, 48, "visibility", 0)
- go("Scene 2")
- end
-
- on hideTokens
- activate(gTokenSprite, "QDBox", 16, 36, 454, 0, "stretch to:", 512, 384)
- set the backColor of sprite gTokenSprite to the foreColor of sprite gTokenSprite
- updateStage()
- end
-
- on showTokens dontHide, fortune
- if dontHide <> 1 then
- hideTokens()
- end if
- set the trails of sprite gTokenSprite to 1
- repeat with x = 1 to gTokens
- activate(gTokenSprite, "Token", 1, 8, 483, 371 - (x * 10), EMPTY, EMPTY, EMPTY)
- updateStage()
- if fortune = "Fortune" then
- if x = (gTokens - 1) then
- if gTokens > 1 then
- set the trails of sprite (gTokenSprite - 2) to 1
- activate(gTokenSprite - 2, "Token", 1, 8, 483, 371 - (gTokens * 10) + 10, EMPTY, EMPTY, EMPTY)
- if gTokens > 2 then
- activate(gTokenSprite - 1, "TokenPatch", 1, 0, 457, 371 - (gTokens * 10) + 18, EMPTY, EMPTY, EMPTY)
- end if
- end if
- updateStage()
- end if
- end if
- end repeat
- if fortune <> "Fortune" then
- deactivate([gTokenSprite])
- end if
- set the trails of sprite gTokenSprite to 0
- updateStage()
- end
-
- on payFortuneTeller
- if gTokens < 1 then
- exit
- end if
- set gTokens to gTokens - 1
- set tokenH to 320
- set tokenV to 180
- set coords to adjustedTokenCoords(tokenH, tokenV, -28, -21, 28, 22, 1)
- spriteBox(gTokenSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedTokenCoords(tokenH, tokenV, -22, -17, 22, 17, 1.10000000000000009)
- spriteBox(gTokenSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedTokenCoords(tokenH, tokenV, -12, -9, 12, 10, 1.20000000000000018)
- spriteBox(gTokenSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedTokenCoords(tokenH, tokenV, -7, -5, 6, 6, 1.40000000000000013)
- spriteBox(gTokenSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- moveHandAcross()
- set coords to adjustedTokenCoords(tokenH, tokenV, -6, -4, 5, 5, 1.80000000000000004)
- spriteBox(gTokenSprite, getAt(coords, 1), getAt(coords, 2), getAt(coords, 3), getAt(coords, 4))
- delayFor(5)
- set the locV of sprite gTokenSprite to -5000
- updateStage()
- delayFor(60)
- deactivate([gTokenSprite - 2, gTokenSprite - 1, gTokenSprite])
- set the trails of sprite (gTokenSprite - 2) to 0
- set the trails of sprite (gTokenSprite - 1) to 0
- set the trails of sprite gTokenSprite to 0
- hideTokens()
- go("Jump")
- end
-
- on addToken whichSprite
- set the locV of sprite (whichSprite - 1) to -5000
- set the locV of sprite whichSprite to -5000
- set the locV of sprite (whichSprite + 1) to -5000
- updateStage()
- set gTokens to gTokens + 1
- showTokens(1)
- playSound("Token")
- go(the frame + 1)
- end
-
- on moveHandAcross
- set userH to checkRange(the mouseH, 128, 393)
- set the loc of sprite gDartHandSprite to point(userH, 358)
- updateStage()
- end
-
- on moveHandDown newV
- if the locV of sprite gDartHandSprite < newV then
- repeat with x = the locV of sprite gDartHandSprite to newV
- set the locV of sprite gDartHandSprite to x
- updateStage()
- set x to x + 1
- end repeat
- set the locV of sprite gDartHandSprite to newV
- updateStage()
- end if
- end
-